"""基金经理相关查询模块"""

MANAGERNAME_SQL = """
SELECT
    fa.SecurityCode AS 基金代码
FROM SecuMain sm
INNER JOIN MF_FundArchives fa ON sm.InnerCode = fa.InnerCode
WHERE fa.Manager LIKE '%' || :manager_name || '%'
"""

MANAGER_SQL = """
SELECT 
    mpi.ChineseName AS 姓名,
    mpi.Background AS 背景介绍
FROM 
    MF_FundManagerNew mfm
INNER JOIN MF_PersonalInfo mpi ON mfm.PersonalCode = mpi.PersonalCode
WHERE mfm.innercode = :innercode
AND mfm.Incumbent = 1
"""


# 经理相关查询函数
def get_manager_info(innercode):
    """获取基金经理信息"""
    return MANAGER_SQL, {'innercode': innercode}

def get_fund_by_manager(manager_name):
    """根据基金经理查询基金"""
    return MANAGERNAME_SQL, {'manager_name': manager_name}
